packages = c("haven", "tidyverse", "data.table", "reshape2", "binsreg",
             "lfe", "gravity", "nleqslv", "BB", "ggplot2",
             "sjlabelled", "sf", "osmdata", "geosphere")
for (p in packages){
  if(!require(p, character.only = T)){
    install.packages(p)
  }
  library(p,character.only = T)
}